package com.jshan.blog.rpcImpl;

import com.jshan.blog.admin.service.LogRpcService;
import com.jshan.blog.base.admin.entity.SysOperationLog;
import com.jshan.blog.service.OperationLogService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

@DubboService
@Slf4j
public class LogRpcServiceImpl implements LogRpcService {

    @Resource
    private OperationLogService operationLogService;

    @Override
    public Boolean saveLog(SysOperationLog sysOperationLog) {
        log.info("saveLog sysOperationLog={}", sysOperationLog);
        return operationLogService.save(sysOperationLog);
    }

    @Override
    public Boolean saveLogs(List<SysOperationLog> logs) {
        return operationLogService.saveBatch(logs);
    }
}
